<?php

namespace app\sendmsg\controller;

use app\AdminRest;
use app\sendmsg\model\CardModular;
use app\sendmsg\model\SendConfig;
use app\sendmsg\model\TimelineTimeline;
use think\App;

class Admin extends AdminRest
{

    // 继承 验证用户登陆
    public function __construct ( App $app )
    {
        parent::__construct( $app );
    }


    /**
     * @author chenniang
     * @DataTime: 2020-04-28 11:57
     * @功能说明:详情
     */
    public function sendConfigInfo(){

        $input = $this->_input;

        $send_model = new SendConfig();

        $data  =  $send_model->configInfo(['uniacid'=>$this->_uniacid]);

        $config= longbingGetAppConfig($this->_uniacid);

        $config['yq_corpid']     = $data['yq_corpid'];

        $config['yq_corpsecret'] = $data['yq_corpsecret'];

        $config['yq_agentid']    = $data['yq_agentid'];

        return $this->success($config);
    }


    /**
     * @author chenniang
     * @DataTime: 2020-04-28 11:59
     * @功能说明:编辑
     */
    public function sendConfigUpdate(){

        $input = $this->_input;

        $send_model = new SendConfig();

        $data  =  $send_model->configUpdate(['uniacid'=>$this->_uniacid],$input);

        return $this->success($data);
    }
}
